<%@page contentType="text/html;charset=UTF-8"%>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<c:set var="ctx" value="${pageContext.request.contextPath}" />
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
<title>list</title>
</head>
<body>
<table width="100%">
    <tr>
        <td><a href="message.do?action=create" mce_href="message.do?action=create">Create Message</a></td>
        <td align="right">username: <sec:authentication property="name" />
        | <a href="j_spring_security_logout" mce_href="j_spring_security_logout">logout</a></td>
    </tr>
</table>
<hr>
<table border="1" width="100%">
    <tr>
        <th>ID</th>
        <th>Message</th>
        <th>Owner</th>
        <th>Create Date</th>
        <th>Update Date</th>
        <th>Operation</th>
    </tr>
    <c:forEach var="item" items="${list}">
        <tr>
            <td>${item.id} </td>
             <td>${item.message} </td>
            <td>${item.owner} </td>
            <td><fmt:formatDate pattern="yyyy-MM-dd HH:mm:ss"
                value="${item.createDate}" /> </td>
            <td><fmt:formatDate pattern="yyyy-MM-dd HH:mm:ss"
                value="${item.updateDate}" /> </td>

            <td><a href="message.do?action=view&id=${item.id}">View</a> |
            <a  href="message.do?action=edit&id=${item.id}">Update</a>
            <sec:accesscontrollist hasPermission="16" domainObject="${item}" >
            	 |<a href="message.do?action=remove&id=${item.id}" >Remove</a>
            </sec:accesscontrollist>
            </td>
        </tr>
    </c:forEach>
</table>
</body>
</html>
